.class public Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;
.super Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaController;
.source "OrmmaSensorController.java"


# static fields
.field private static final LOG_TAG:Ljava/lang/String; = "OrmmaSensorController"


# instance fields
.field private mAccel:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

.field private mLastX:F

.field private mLastY:F

.field private mLastZ:F


# direct methods
.method public constructor <init>(Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView;Landroid/content/Context;)V
    .locals 1
    .parameter "adView"
    .parameter "context"

    .prologue
    const/4 v0, 0x0

    .line 58
    invoke-direct {p0, p1, p2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaController;-><init>(Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView;Landroid/content/Context;)V

    .line 39
    iput v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mLastX:F

    .line 44
    iput v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mLastY:F

    .line 49
    iput v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mLastZ:F

    .line 59
    new-instance v0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

    invoke-direct {v0, p2, p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;-><init>(Landroid/content/Context;Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;)V

    iput-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mAccel:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

    .line 60
    return-void
.end method


# virtual methods
.method public getHeading()F
    .locals 3
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    .prologue
    .line 160
    const-string v0, "OrmmaSensorController"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "getHeading: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mAccel:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

    invoke-virtual {v2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;->getHeading()F

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 161
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mAccel:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;->getHeading()F

    move-result v0

    return v0
.end method

.method public getTilt()Ljava/lang/String;
    .locals 4
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    .prologue
    .line 139
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "{ x : \""

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mLastX:F

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\", y : \""

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mLastY:F

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\", z : \""

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mLastZ:F

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\"}"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 140
    .local v0, tilt:Ljava/lang/String;
    const-string v1, "OrmmaSensorController"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "getTilt: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 141
    return-object v0
.end method

.method public onHeadingChange(F)V
    .locals 6
    .parameter "f"

    .prologue
    .line 150
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "window.ormmaview.fireChangeEvent({ heading: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    float-to-double v2, p1

    const-wide v4, 0x404ca5dc1a63c1f8L

    mul-double/2addr v2, v4

    double-to-int v2, v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "});"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 151
    .local v0, script:Ljava/lang/String;
    const-string v1, "OrmmaSensorController"

    invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 152
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mOrmmaView:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView;

    invoke-virtual {v1, v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView;->injectJavaScript(Ljava/lang/String;)V

    .line 153
    return-void
.end method

.method public onShake()V
    .locals 2

    .prologue
    .line 114
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mOrmmaView:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView;

    const-string v1, "Ormma.gotShake()"

    invoke-virtual {v0, v1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView;->injectJavaScript(Ljava/lang/String;)V

    .line 115
    return-void
.end method

.method public onTilt(FFF)V
    .locals 3
    .parameter "x"
    .parameter "y"
    .parameter "z"

    .prologue
    .line 125
    iput p1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mLastX:F

    .line 126
    iput p2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mLastY:F

    .line 127
    iput p3, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mLastZ:F

    .line 129
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "window.ormmaview.fireChangeEvent({ tilt: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->getTilt()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "})"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 130
    .local v0, script:Ljava/lang/String;
    const-string v1, "OrmmaSensorController"

    invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 131
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mOrmmaView:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView;

    invoke-virtual {v1, v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaView;->injectJavaScript(Ljava/lang/String;)V

    .line 132
    return-void
.end method

.method public startHeadingListener()V
    .locals 1

    .prologue
    .line 94
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mAccel:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;->startTrackingHeading()V

    .line 95
    return-void
.end method

.method public startShakeListener()V
    .locals 1

    .prologue
    .line 73
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mAccel:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;->startTrackingShake()V

    .line 74
    return-void
.end method

.method public startTiltListener()V
    .locals 1

    .prologue
    .line 66
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mAccel:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;->startTrackingTilt()V

    .line 67
    return-void
.end method

.method stop()V
    .locals 0

    .prologue
    .line 108
    return-void
.end method

.method public stopAllListeners()V
    .locals 1

    .prologue
    .line 166
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mAccel:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;->stopAllListeners()V

    .line 167
    return-void
.end method

.method public stopHeadingListener()V
    .locals 1

    .prologue
    .line 101
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mAccel:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;->stopTrackingHeading()V

    .line 102
    return-void
.end method

.method public stopShakeListener()V
    .locals 1

    .prologue
    .line 87
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mAccel:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;->stopTrackingShake()V

    .line 88
    return-void
.end method

.method public stopTiltListener()V
    .locals 1

    .prologue
    .line 80
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/OrmmaSensorController;->mAccel:Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/ormma/listener/AccelListener;->stopTrackingTilt()V

    .line 81
    return-void
.end method
